package com.myk.game.heroscuffle.skills;

import com.myk.game.heroscuffle.game.Hero;
import com.myk.game.heroscuffle.game.Skill;
import com.myk.game.heroscuffle.signs.TimeSign_DuChong;

public class Skill_GuiChao extends Skill {

    private static final int UNIT_AMOUNT = 40;

    public Skill_GuiChao() {
        super("归巢", "回收所有毒虫给自己恢复生命值。", 0, Integer.MAX_VALUE);
    }

    @Override
    protected void onTrigger() {
        int count = 0;
        for (Hero aliveHero : game.pool.getAllAliveHeroes()) {
            if (aliveHero.hasSign(TimeSign_DuChong.class)) {
                aliveHero.removeSign(TimeSign_DuChong.class);
                count++;
            }
        }
        int addHp = count * UNIT_AMOUNT;
        game.ui.printMsg("回收了" + count + "只毒虫," + hostHero.getObviousName());
        hostHero.addHpWithPrint(addHp);
    }

    @Override
    protected void onUpdate() {

    }

    @Override
    protected void onInit() {

    }
}
